(define (merge! a b less?)
    (define (loop r a b)
        (if (less? (car b) (car a))
            (begin
                (set-cdr! r b)
                (if (null? (cdr b))
                    (set-cdr! b a)
                    (loop b a (cdr b)) ))
            ;; (car a) <= (car b)
            (begin
                (set-cdr! r a)
                (if (null? (cdr a))
                    (set-cdr! a b)
                    (loop a (cdr a) b)) )) )
    (cond
        ((null? a) b)
        ((null? b) a)
        ((less? (car b) (car a))
            (if (null? (cdr b))
                (set-cdr! b a)
                (loop b a (cdr b)))
            b)
        (else ; (car a) <= (car b)
            (if (null? (cdr a))
                (set-cdr! a b)
                (loop a (cdr a) b))
            a)))

(merge! (list 1 2 3) (list 2 4 5) <)